package com.hp.ssmp.controller;

import com.hp.ssmp.entity.TCommentReply;
import com.hp.ssmp.service.ReplyService;
import com.hp.ssmp.util.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/reply")
public class ReplyController {

    @Resource
    private ReplyService replyService;

    @PostMapping("/add")
    public R add(TCommentReply reply) {
        boolean result = replyService.addReply(reply);
        if (result) {
            return R.success();
        } else {
            return R.error();
        }
    }
}
